//
//  HomePageViewController.m
//  Position
//
//  Created by caihengcheng on 16/8/5.
//  Copyright © 2016年 Microwo. All rights reserved.
//

#import "HomePageViewController.h"

@interface HomePageViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@property (weak, nonatomic) IBOutlet UITextField *addressTextField;
@property (weak, nonatomic) IBOutlet UITextField *longitudeTextField;
@property (weak, nonatomic) IBOutlet UITextField *latitudeTextField;

@end

@implementation HomePageViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //设置代理
    self.phoneNumberTextField.delegate = self;
    self.addressTextField.delegate = self;
    self.longitudeTextField.delegate = self;
    self.latitudeTextField.delegate = self;
    
    //
    //
    
}

#pragma mark - 点击空白处回收键盘
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.phoneNumberTextField resignFirstResponder];
    [self.addressTextField resignFirstResponder];
    [self.longitudeTextField resignFirstResponder];
    [self.latitudeTextField resignFirstResponder];
}

#pragma mark - 点击返回键回收键盘
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return NO;
}

- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    NSLog(@"didBeginEditing");
}

- (void)textFieldDidEndEditing:(UITextField *)textField
{
    NSLog(@"didEndEditing");
}

#pragma mark - 限制文本框的输入内容
- (IBAction)myTextFieldDidChanged:(UITextField *)textField
{
    
    
    //
    if (self.phoneNumberTextField.isEditing)
    {
        
    }
    else if (self.addressTextField.isEditing)
    {
        
    }
    else if (self.longitudeTextField.isEditing)
    {
        
    }
    else if (self.latitudeTextField.isEditing)
    {
        
    }
}




#pragma mark -
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    
}



@end
